﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;
using PlanningGIS.ArcGIS;
using PlanningGIS.Framework.Config;
using PlanningGIS.ManageUtility;
using PlanningGIS.Util.Log;
using PlanningGIS.Win.Controls;

namespace PlanningGIS.Manager
{
    /// <summary>
    /// 系统入口
    /// </summary>
    static class Program
    {
        /// <summary>
        /// 应用程序的主入口点。
        /// </summary>
        [STAThread]
        static void Main()
        {
            
            try
            {
                AoHelper.Initialize();
                Application.EnableVisualStyles();
                Application.SetCompatibleTextRenderingDefault(false);
                ManageHelper.DBContext = DbConnectHelper.CreateDbContextByIntance("MT");
                FrmLogin frm = new FrmLogin();
                if (frm.ShowDialog() == DialogResult.OK)
                {
                    Application.Run(new FrmMain());
                }                
            }
            catch (Exception ex)
            {
                LogHelper.WriteErrorText(ex);
                AoHelper.Shutdown();
                MsgHelper.ShowErrorMsgbox(ex.Message);
            }
            
        }
    }
}
